/*
 * @Date: 2022-12-08 15:35:57
 * @LastEditTime: 2023-02-02 16:32:10
 * @Description: 
 */

import { getCds } from "@/utils/net";
import IHomeMode from "./IHomeMode";
import { useUserStore } from "@/stores/modules/user";


/**
 * @description: Home数据持久化实现层
 * @return {*}
 */
export default class HomeModelImp implements IHomeMode {
    getCds(): Promise<void> {
        return new Promise((resolve, reject) => {
            const systemCode = useUserStore().getCurrentSystemCode
            console.log(systemCode)
            getCds(useUserStore().getCurrentSystemCode).then((result) => {
                if (result.data.status) {
                    resolve(result.data.data[0].children);
                }
            }).catch((err) => {
                reject(new Error(err));
            })
        })
    }


}
